package com.thti.mecool.client.activity;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

import com.thti.mecool.client.base.BaseActivity;
import com.thti.mecool.client.base.Cache;
import com.thti.mecool.client.util.StringUtil;
import com.thti.mecool.client.widget.ProgressDialogWidget;
import com.thti.mecool.client.widget.Toolbar;

public class UsercenterShowMsgActivity extends BaseActivity {
	TextView title,time,content;
	public static Handler handler;
	@SuppressWarnings("unused")
	private ProgressDialogWidget progressDialogWidget;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.noTitle();
		setContentView(R.layout.mecool_user_center_show_msg);
		Cache.add(this);
		init();
		handler=new Handler(){
			@Override
			public void handleMessage(Message msg) {
				// TODO Auto-generated method stub
				super.handleMessage(msg);
			}
			
		};
//		title.setText("买一送一活动");
//		time.setText("发送时间:2012-5-16 18:00");
//		content.setText("各大门店注意,五一期间可乐买一送一活动");
		initToolbar();
		getData();
	}
	
	private void init(){
//		title=(TextView)findViewById(R.id.mecool_user_center_show_msg_title);
//		time=(TextView)findViewById(R.id.mecool_user_center_show_msg_time);
		content=(TextView)findViewById(R.id.mecool_user_center_show_msg_content);
//		progressDialogWidget=new ProgressDialogWidget(this);
	}
	
	private void getData(){
//		String id=getIntent().getStringExtra("id");

//		GetSend.getMessage(id);
//		progressDialogWidget.setDismissTime(16);
		String body=getIntent().getStringExtra("body")+"";
		content.setText(StringUtil.stringFilter(StringUtil.ToSBC(body)));
	}
	
	public void initToolbar(){
		Toolbar toolbar=new Toolbar(this);
		Toolbar.hideRightButton();
		toolbar.setToolbarCentreText("消息内容");
		Toolbar.left_btn.setOnClickListener(leftbuttonListener);
		Toolbar.left_btn.setImageResource(R.drawable.mecool_go_back);
	}
	private OnClickListener leftbuttonListener=new ImageButton.OnClickListener(){

		@Override
		public void onClick(View v) {
			finish();
	}};
		
}
